home *** CD-ROM | disk | FTP | other *** search
/ Champak 123 / (Vol 123) Jan 13 2011.iso / Games / go-fishing.swf / scripts / DefineSprite_222 / frame_5 / DoAction.as
Text File  |  2011-01-13  |  767b  |  35 lines

  1. fishhook_y = getProperty("/ship/fishhook", _Y);
  2. fish_x = getProperty(my_name, _X);
  3. fish_y = getProperty(my_name, _Y);
  4. delta_x = eval("/:fishhook_x") - fish_x;
  5. delta_y = fishhook_y - fish_y;
  6. if(eval("/:hit") == "1")
  7. {
  8.    if((fishhook_width + fish_width) * (fishhook_width + fish_width) >= delta_x * delta_x + delta_y * delta_y)
  9.    {
  10.       gotoAndPlay(25);
  11.       set("/:hit","0");
  12.       set("/:movie_enable","0");
  13.    }
  14. }
  15. if("600" < fish_x)
  16. {
  17.    gotoAndStop(1);
  18.    set("/:count","/:count - 1");
  19.    set("/:a5","0");
  20.    setProperty(my_name, _X, former_x);
  21.    setProperty(my_name, _Y, former_y);
  22. }
  23. else
  24. {
  25.    setProperty(my_name, _X, fish_x + speed);
  26. }
  27. if(turn_o == "3")
  28. {
  29.    turn = random("30");
  30. }
  31. if(turn == "19")
  32. {
  33.    gotoAndPlay(15);
  34. }
  35.